<?php
/**
 * Created by PhpStorm
 * USER MingTingLiang   QQ 915802070
 * Date 2020-12-16-016   10:01
 */

require "Subject.php";
require "Manager.php";
require "BusinessLeader.php";
require "ProdLeader.php";
require "LastLeader.php";

if ($_POST) {
    if (isset($_POST["createSubject"])) {

        $subject = new Subject();
        $subject->content = "文案内容";
        $subject->save();

    }

    if (isset($_POST["step"])) {
        $busLeader = new BusinessLeader();
        $prodLeader = new ProdLeader();
        $lastLeader = new LastLeader();

        //维护关系
        $busLeader->setLeader($prodLeader);
        $prodLeader->setLeader($lastLeader);

        //echo "66666666666";
        $busLeader->step("通过");
    }
}

?>

<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
<div>
    <div>

        <h2>流程界面演示</h2>
    </div>
    <div>
        <form method="post">
            <textarea name="createSubject"></textarea>
            <button type="submit">创建文案</button>
        </form>
        <hr>
        <form action="" method="post" >
           <input type="hidden" name="step">

            <button type="submit">领导审批</button>
        </form>
    </div>


</div>

</body>
</html>